ÀÎÅÍ³Ý ÁÖ¼Ò(°øÅë »çÇ×)
<SCRIPT>
var br='<BR>'; // ÁٹٲÞ(¿¹Á¦ °øÅë)
function Checkt(URLString){
var str=''; // Ãâ·Â ¹®ÀÚ¿ º¯¼ö ¼±¾ð
str+='URIString='+URIString+br; // URI ¹®ÀÚ¿ Ãâ·Â
str+='encodeURI(URIString)='+encodeURI(URIString)+br; // ¿£ÄÚµùµÈ URI ¹®ÀÚ¿ Ãâ·Â
str+='decodeURI(URIString)='+decodeURI(URIString)+br+br; // µðÄÚµùµÈ URI ¹®ÀÚ¿ Ãâ·Â
str+='decodeURI(encodeURI(URIString))='+decodeURI(encodeURI(URIString)); // ¿£ÄÚµùµÈ URI ¹®ÀÚ¿À» µðÄÚµùÇÏ¿© Ãâ·Â
return str; // °á°ú ¹®ÀÚ¿ ¹Ýȯ
}
±âº»ÀûÀÎ ÀÎÅÍ³Ý ÁÖ¼Ò
document.write(Check('http://trio.co.kr'));
Äõ¸® ÀÎÅÍ³Ý ÁÖ¼Ò
document.write(Check('http://trio.co.kr/index.asp?file=encodeURI.html'));
ºñ ASCII/ÇÑ±Û ÀÎÅÍ³Ý ÁÖ¼Ò
document.write(Check('../../ÇѱÛ.html'));
ºñ ASCII/ÇÑ±Û ÀÎÅÍ³Ý ÁÖ¼Ò
document.write(Check('http://trio.co.kr/index.asp?file=../Æú ´õ/Åä³¢.gif'));
<SCRIPT>
var br='<BR>'; // ÁٹٲÞ
var URIString='http://trio.co.kr/index.asp?file=encodeURI.html'; // URI ¹®ÀÚ¿ ÇÒ´ç
str='URIString='+URIString+br; // URI ¹®ÀÚ¿ Ãâ·Â
var URIencoded=encodeURIComponent(URIString);
str+='encodeURIComponent(URIString)='+URIencoded+br+br; // encodeURIComponent·Î ¿£ÄÚµùµÈ URI ¹®ÀÚ¿ Ãâ·Â
str+='decodeURIComponent(URIencoded)='+decodeURIComponent(URIencoded)+br;
// encodeURIComponent·Î ¿£ÄÚµùµÈ ¹®ÀÚ¿À» decodeURIComponent·Î µðÄÚµùÇÑ URI component ¹®ÀÚ¿ Ãâ·Â
document.write(str); // °á°ú ¹®ÀÚ¿ Ãâ·Â
</SCRIPT>
<SCRIPT>
var br='<BR>'; // ÁٹٲÞ
var str='';
var URIString='http://trio.co.kr';
str+='URIString='+URIString+br;
str+='encodeURIComponent(URIString)='+encodeURIComponent(URIString)+br;
str+='decodeURIComponent(URIString)='+decodeURIComponent(URIString)+br+br;
var URIString='http://trio.co.kr/index.asp?file=encodeURI.html';
str+='URIString='+URIString+br;
str+='decodeURIComponent(URIString)='+decodeURIComponent(URIString)+br;
str+='encodeURIComponent(URIString)='+encodeURIComponent(URIString)+br+br;
var URIString='ÇѱÛ.html';
str+='URIString='+URIString+br;
str+='encodeURIComponent(URIString)='+encodeURIComponent(URIString)+br;
str+='decodeURIComponent(URIString)='+decodeURIComponent(URIString)+br;
str+='decodURIcomp(encodeURIComponent(URIString))='+decodeURIComponent(encodeURIComponent(URIString))+br+br;
var URIString='%ED%95%9C%EA%B8%80.html';
str+='URIString='+URIString+br;
str+='decodeURIComponent(URIString)='+decodeURIComponent(URIString)+br;
document.write(str); // °á°ú ¹®ÀÚ¿ Ãâ·Â
</SCRIPT>
var br='<BR>'; // ÁٹٲÞ
var URIString='http://trio.co.kr/index.asp?file=encodeURI.html'; // URI ¹®ÀÚ¿ ÇÒ´ç
str='URIString='+URIString+br; // URI ¹®ÀÚ¿ Ãâ·Â
var URIencoded=escape(URIString);
str+='escape(URIString)='+URIencoded+br+br;
// escape·Î ¿£ÄÚµùµÈ URI ¹®ÀÚ¿ Ãâ·Â, URI ¹®ÀÚ¿Àº ¿¡½ºÄÉÀÔÇÏ¿© ÁÖ¼Ò·Î »ç¿ëÇÒ ¼ö ¾ø´Ù.
str+='unescape(URIencoded)='+unescape(URIencoded)+br;
// escape·Î ¿£ÄÚµùµÈ ¹®ÀÚ¿À» unescape·Î µðÄÚµùÇÑ URI component ¹®ÀÚ¿ Ãâ·Â
document.write(str); // °á°ú ¹®ÀÚ¿ Ãâ·Â
</SCRIPT>